/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author lnngu_000
 */
@Entity
@Table(name = "MessageCatering")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MessageCatering.findAll", query = "SELECT m FROM MessageCatering m"),
    @NamedQuery(name = "MessageCatering.findByMessageId", query = "SELECT m FROM MessageCatering m WHERE m.messageId = :messageId"),
    @NamedQuery(name = "MessageCatering.findByCreated", query = "SELECT m FROM MessageCatering m WHERE m.created = :created"),
    @NamedQuery(name = "MessageCatering.findBySenderId", query = "SELECT m FROM MessageCatering m WHERE m.senderId = :senderId"),
    @NamedQuery(name = "MessageCatering.findByRecipient", query = "SELECT m FROM MessageCatering m WHERE m.recipient = :recipient"),
    @NamedQuery(name = "MessageCatering.findByTitle", query = "SELECT m FROM MessageCatering m WHERE m.title = :title"),
    @NamedQuery(name = "MessageCatering.findByContent", query = "SELECT m FROM MessageCatering m WHERE m.content = :content"),
    @NamedQuery(name = "MessageCatering.findByStatus", query = "SELECT m FROM MessageCatering m WHERE m.status = :status")})
public class MessageCatering implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @Column(name = "messageId")
    private Integer messageId;
    @Size(max = 50)
    @Column(name = "created")
    private String created;
    @Column(name = "senderId")
    private Integer senderId;
    @Column(name = "recipient")
    private Integer recipient;
    @Size(max = 500)
    @Column(name = "title")
    private String title;
    @Size(max = 2147483647)
    @Column(name = "content")
    private String content;
    @Column(name = "status")
    private Boolean status;
    
    @Transient
    private String senderName;
    
    @Transient
    private String recipientName;

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public String getRecipientName() {
        return recipientName;
    }

    public void setRecipientName(String recipientName) {
        this.recipientName = recipientName;
    }
    

    public MessageCatering() {
    }

    public MessageCatering(Integer messageId) {
        this.messageId = messageId;
    }

    public Integer getMessageId() {
        return messageId;
    }

    public void setMessageId(Integer messageId) {
        this.messageId = messageId;
    }

    public String getCreated() {
        return created;
    }

    public void setCreated(String created) {
        this.created = created;
    }

    public Integer getSenderId() {
        return senderId;
    }

    public void setSenderId(Integer senderId) {
        this.senderId = senderId;
    }

    public Integer getRecipient() {
        return recipient;
    }

    public void setRecipient(Integer recipient) {
        this.recipient = recipient;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (messageId != null ? messageId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MessageCatering)) {
            return false;
        }
        MessageCatering other = (MessageCatering) object;
        if ((this.messageId == null && other.messageId != null) || (this.messageId != null && !this.messageId.equals(other.messageId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.entity.MessageCatering[ messageId=" + messageId + " ]";
    }
    
}
